package com.ltmall.api.manager;

import com.ltmall.api.bean.*;
import com.ltmall.api.util.PageUtil;

import java.util.List;

public interface WalletManager {
	// 添加代金券
	public boolean addWalletCoupon(WalletCoupon coupon);

	// 添加礼品卡
	public boolean addWalletGiftCard(WalletGiftCard giftCard);

	// 添加现金
	public boolean addWalletCash(WalletCash cash);
	
	//添加礼品卡帐号
	public boolean addGiftCardCount(WalletGiftCardCount count);

	// 获取钱包
	public WalletCash getWalletCash(int userID);

	// 获取代金券的数量
	public int getCouponNumber(int userID);

	// 获取礼品卡的数量
	public int getGiftCardNumber(int userID);

	//获取代金券列表
	public List<WalletCoupon> couponList(int userID, PageUtil page);
	//获取购物卡列表
	public List<WalletGiftCard> cardList(int userID, PageUtil page, int orderID, int type);
	//礼品卡激活
	public boolean cardActivation(int userID, int cardID, String code);
	
	//获取代金券
	public WalletCoupon getCoupon(int couponID, int userID);
	//设置代金券失效
	public boolean updateCouponInvalid(int couponID, int userID);
	
	// 修改礼品卡的所有者
	public boolean updateGiftCardOwner(int cardID, int userID);

	// 修改礼品卡的所有者为购买者
	public boolean updateGiftCardOwnerASBuyer(int cardID);

	// 获取礼品卡
	public WalletGiftCard getGiftCard(int cardID);
	
	//获取礼品卡帐号金额
	public WalletGiftCardCount getgiftCardCount(int userID);
	
	//帐号充值
	public boolean updategiftCardCount(int userID, float money);
	
	//设置礼品卡激活码
	public boolean setGiftcardCode(int cardID, String code);
	
	//创建礼品卡订单
	public boolean addGiftcradOrder(GiftCardOrder order);
	
	//礼品卡订单
	public List<GiftCardOrder> giftcardOrderList(int userID, PageUtil page);
	
	//获取礼品卡订单
	public GiftCardOrder getGiftCardOrder(int orderID, int userID);
	
	//修改订单的验证码
	public boolean updateCardCode(int orderID, String code);
	
	//修改礼品卡订单状态
	public boolean updateCardCodeStation(int orderID, int station);
	
	//获取用户的充值记录
	public List<ThRechargeRecord> getRechargeRecordsByUser(int userID, PageUtil page);
	
	//获取用户的消费记录
	public List<ThOutcomeRecord> getOutcomeRecordsByUser(int userID, PageUtil page);
	
	//获取钱包[可用]金额
	public ThHcWallet getWalletByUser(int userID);
	
	//判断钱包是否为空
	public Boolean isHaveWalletByUser(int userID);
	
	//获取钱包渠道信息
	public ThRechargeChannel getRechargeChannelByID(int channelID);
	
	//获取钱包渠道列表
	public List<ThRechargeChannel> getRechargeChannelList();
	
	//创建充值记录
	public boolean rechargeRecordCreate(ThRechargeRecord record);
	
	//根据交易号获取充值记录
	public ThRechargeRecord rechargeRecordGetByTradeNo(String tradeNo);
	
	//更新充值记录
	public boolean rechargeRecordUpdate(String tradeNo, int state);
	
	//创建冻结记录
	public boolean freezonRecordCreate(ThFrozenRecord freezonRecord);
	// 支出记录
	public boolean outcomeRecordsCreate(ThOutcomeRecord outcomeRecord);
	// 乡币账户操作
	public boolean hcWalletCreate(ThHcWallet hcWallet);
	public boolean hcWalletUpdate(int user_id, int availe_amounts, int freezon_amounts);
	public boolean hcWalletAvaileUpdateByID(int amounts, int id);
	public boolean hcWalletAvaileUpdateByUserID(int amounts, int userID);
}
